package com.um.jdy.baofu.entity.account;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;
import java.util.List;

/**
 * 账户加值减值对像
 * @author dasheng(大圣)
 * @date 2025/4/4 21:59
 * @Company www.baofu.com
 */
@Slf4j
@Getter
@Setter
@ToString
public class ValuesActionEntity
{
    //版本号1.0.0
    private String version;
    //请求流水号
    private String transSerialNo;
    //请求日期 时间 yyyyMMddHHmmss
    private String reqTime;
    //平台商户号
    private String platformNo;
    //商户订单号（自己生成）
    private String transOrderNo;
    //商户原支付交易订单的订单号，用于匹配资金对账文件用
    private String orderNo;
    //手续费承担方
    private String feeMemberId;
    //账本类型  BALANCE-余额户,TRANSIT-在途户
    private String accountType;
    //减值总金额 金额,单位：元
    private BigDecimal dealAmount;
    private String orderType;
    private List<ValuesAcctInfoEntity> acctInfo;

    public void dealAmountAct(){
        try{
            if(acctInfo != null)
            {
                dealAmount = new BigDecimal(0);
                for (ValuesAcctInfoEntity temp:acctInfo){
                    BigDecimal tempAmt = new BigDecimal(temp.getTransAmount());
                    dealAmount = dealAmount.add(tempAmt);
                }
            }

        }catch (Exception ex){
            log.error("总金额计算异常：",ex);
        }
    }
}
